package com.fengze.shop.web.shop;

import com.fengze.shop.domain.ProductDo;
import com.fengze.shop.service.BusinessService;
import com.fengze.shop.service.impl.BusinessServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016-11-19.
 */
public class HotListServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req,resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        String proNum = req.getParameter("proNum");
        String flag = req.getParameter("flag");

        BusinessService bs = new BusinessServiceImpl();

        List<ProductDo> proLs = bs.queryHotList(proNum);


        req.setAttribute("proLs", proLs);

        req.getRequestDispatcher("/shop/hot-list.jsp").forward(req,resp);

    }
}
